package view;

import java.awt.Color;
import java.util.Observable;
import java.util.Observer;

import javax.swing.BorderFactory;
import javax.swing.JLabel;
import javax.swing.border.Border;

import xl.Address;

public class CurrentView extends JLabel implements Observer {
    public CurrentView() {
        super("A1");
    	Border gap = BorderFactory.createEmptyBorder(2, 2, 2, 2);
        setBackground(Color.WHITE);
        setOpaque(true);
        setBorder(gap);
        setText("");
    }

	public void update(Observable o, Object arg) {
		if (arg instanceof Address) {
			setText(((Address)arg).toString());
		}
	}
}